package com.ebt.dl.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ebt.dl.dao.UserDao;
import com.ebt.dl.domain.User;

@Service
public class UserService {

	@Autowired
	private UserDao userDao;

	public List<User> getAllUsers() {
		return userDao.findAll();
	}

	public User getUserById(long id) {
		return userDao.findOne(id);
	}

	public User saveUser(User user) {
		return userDao.save(user);
	}

	public void deleteUser(long id) {
		userDao.delete(id);
	}

	public User getUserByUserId(String userId) {
		return userDao.findByUserId(userId);
	}
}
